﻿using System;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;

namespace ClothingShopping.Data
{
    /// <summary>
    /// 用户表
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = false)]
    public partial class User
    {
        /// <summary>
        /// 用户id
        /// </summary>
        [JsonProperty, Column(DbType ="INT",IsIdentity = true, IsPrimary = true)]
        public int user_id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [JsonProperty, Column(DbType ="NVARCHAR(20)")]
        public string user_name { get; set; }

        /// <summary>
        /// 性别（0男，1女
        /// </summary>
        [JsonProperty, Column(CanInsert = false)]
        public bool? SEX { get; set; } = false;

        /// <summary>
        /// 登录账号
        /// </summary>
        [JsonProperty, Column(DbType = "NVARCHAR(20)")]
        public string login_name { get; set; }

        /// <summary>
        /// MD5加密密码
        /// </summary>
        [JsonProperty, Column(DbType = "NVARCHAR(200)")]
        public string? md5_password { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [JsonProperty, Column(DbType = "NVARCHAR(20)")]
        public string? password { get; set; }

        /// <summary>
        /// 微信openID
        /// </summary>
        [JsonProperty, Column(DbType = "VARCHAR(100)")]
        public string? open_id { get; set; }

        /// <summary>
        /// 电子邮件
        /// </summary>
        [JsonProperty, Column(DbType = "NVARCHAR(20)")]
        public string? email { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        [JsonProperty, Column(DbType ="VARCHAR(20)")]
        public string? phone { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [JsonProperty, Column(DbType ="DATETIME")]
        public DateTime? create_time {  get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [JsonProperty,Column(DbType ="NVARCHAR(20)")]
        public string? modifier { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [JsonProperty, Column(DbType = "DATETIME")]
        public DateTime? mTime { get; set; }

        /// <summary>
        /// 登录时间
        /// </summary>
        [JsonProperty, Column(DbType ="DATETIME")]
        public DateTime? login_time { get; set; }

        /// <summary>
        /// 上一次登录时间
        /// </summary>
        [JsonProperty, Column(DbType ="DATETIME")]
        public DateTime? last_login_time { get; set; }

        /// <summary>
        /// 登录次数
        /// </summary>
        [JsonProperty, Column(DbType ="INT")]
        public int? count { get; set; }

        /// <summary>
        /// 密码错误次数
        /// </summary>
        [JsonProperty, Column(DbType = "INT")]
        public int? mmcwcs{ get; set; }

        /// <summary>
        /// 状态（0：停用 1：启用）
        /// </summary>
        [JsonProperty,Column(DbType ="CHAR(1)")]
        public char state { get; set; }='1';
    }
}
